/* GameBoardCell.java  */

/**GameBoardCells are objects that represent the cells of a GameBoard. A GameBoard is a 2d array of GameBoardCells (8 x 8 2d array).
 *
 */

package player;

public class GameBoardCell {
	protected int color;
	protected boolean whiteGoal =false;
	protected boolean blackGoal =false;
	
	protected int x;
	protected int y;
	protected GameBoardCell[] connections;
	
	/** Constructor for GameBoardCell
	 * @param x coordinate
	 * @param y coordinate
	 * 1) marks the this.color field to reflect either CORNER or EMPTY
	 * 2) Marks whether the cell is a goal cell or not (whiteGoal or blackGoal is true).
	 */
	public GameBoardCell(int x, int y) {
		connections = new GameBoardCell[8];
		this.x = x;
		this.y = y;
		
		if ( (x==0 && y==0) || (x==7 && y ==0) || (x==0 && y ==7) || (x==7 && y==7)) {
			this.color = GameBoard.CORNER;
		} else {
			this.color = GameBoard.EMPTY;
		}
		
		if ((x==0 || x==7) && this.color != GameBoard.CORNER){ 
			this.whiteGoal = true;
		} else if ((y==0 || y==7) && this.color !=GameBoard.CORNER) {
			this.blackGoal =true;
		}
	}
	
	public String toString() {
		return "[ Position: (" + x + ", " + y + ")    Color: " + color + " ]";
	}
}
